{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Dealing with Low Confidence Situations\n",
    "\n",
    "First we analyze a few scenarios where spurious examines or clicks result in inaccurate relevance grades. We then augment the SDBN judgments with a beta prior to better model the amount of confidence we have in the underlying click data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append(\"..\")\n",
    "sys.path.append(\"../ltr\")\n",
    "from aips import *\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy\n",
    "from ltr.sdbn_functions import *\n",
    "\n",
    "# if using a Jupyter notebook, includue:\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sess_id</th>\n",
       "      <th>query</th>\n",
       "      <th>rank</th>\n",
       "      <th>doc_id</th>\n",
       "      <th>clicked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>50002</td>\n",
       "      <td>blue ray</td>\n",
       "      <td>0.0</td>\n",
       "      <td>600603141003</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>50002</td>\n",
       "      <td>blue ray</td>\n",
       "      <td>1.0</td>\n",
       "      <td>827396513927</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>50002</td>\n",
       "      <td>blue ray</td>\n",
       "      <td>2.0</td>\n",
       "      <td>24543672067</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>50002</td>\n",
       "      <td>blue ray</td>\n",
       "      <td>3.0</td>\n",
       "      <td>719192580374</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>50002</td>\n",
       "      <td>blue ray</td>\n",
       "      <td>4.0</td>\n",
       "      <td>885170033412</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74995</th>\n",
       "      <td>5001</td>\n",
       "      <td>transformers dark of the moon</td>\n",
       "      <td>10.0</td>\n",
       "      <td>47875841369</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74996</th>\n",
       "      <td>5001</td>\n",
       "      <td>transformers dark of the moon</td>\n",
       "      <td>11.0</td>\n",
       "      <td>97363560449</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74997</th>\n",
       "      <td>5001</td>\n",
       "      <td>transformers dark of the moon</td>\n",
       "      <td>12.0</td>\n",
       "      <td>93624956037</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74998</th>\n",
       "      <td>5001</td>\n",
       "      <td>transformers dark of the moon</td>\n",
       "      <td>13.0</td>\n",
       "      <td>97363532149</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74999</th>\n",
       "      <td>5001</td>\n",
       "      <td>transformers dark of the moon</td>\n",
       "      <td>14.0</td>\n",
       "      <td>400192926087</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1775000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       sess_id                          query  rank        doc_id  clicked\n",
       "0        50002                       blue ray   0.0  600603141003     True\n",
       "1        50002                       blue ray   1.0  827396513927    False\n",
       "2        50002                       blue ray   2.0   24543672067    False\n",
       "3        50002                       blue ray   3.0  719192580374    False\n",
       "4        50002                       blue ray   4.0  885170033412     True\n",
       "...        ...                            ...   ...           ...      ...\n",
       "74995     5001  transformers dark of the moon  10.0   47875841369    False\n",
       "74996     5001  transformers dark of the moon  11.0   97363560449    False\n",
       "74997     5001  transformers dark of the moon  12.0   93624956037    False\n",
       "74998     5001  transformers dark of the moon  13.0   97363532149    False\n",
       "74999     5001  transformers dark of the moon  14.0  400192926087    False\n",
       "\n",
       "[1775000 rows x 5 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_sessions()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "sessions = all_sessions()\n",
    "products = fetch_products(doc_ids=sessions[\"doc_id\"].unique())\n",
    "\n",
    "def print_dataframe(dataframe):\n",
    "    pandas.set_option(\"display.max_colwidth\", 36)\n",
    "    pandas.set_option(\"display.width\", 120)\n",
    "    merged = dataframe.merge(products[[\"upc\", \"name\"]], left_on='doc_id', right_on='upc', how='left')\n",
    "    print(merged.rename(columns={\"upc\": \"doc_id\"}).set_index(\"doc_id\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Listing 11.11\n",
    "\n",
    "Computing relevance judgments for `blue ray` a simulated tail query that represents a misspelling with sparse data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%load -s caclulate_examine_probability,calculate_clicked_examined,calculate_grade ../ltr/sdbn_functions.py\n",
    "def caclulate_examine_probability(sessions):\n",
    "    last_click_per_session = sessions.groupby([\"clicked\", \"sess_id\"])[\"rank\"].max()[True]\n",
    "    sessions[\"last_click_rank\"] = last_click_per_session\n",
    "    sessions[\"examined\"] = sessions[\"rank\"] <= sessions[\"last_click_rank\"]\n",
    "    return sessions\n",
    "\n",
    "def calculate_clicked_examined(sessions):\n",
    "    sessions = caclulate_examine_probability(sessions)\n",
    "    return sessions[sessions[\"examined\"]] \\\n",
    "        .groupby(\"doc_id\")[[\"clicked\", \"examined\"]].sum()\n",
    "\n",
    "def calculate_grade(sessions):\n",
    "    sessions = calculate_clicked_examined(sessions)\n",
    "    sessions[\"grade\"] = sessions[\"clicked\"] / sessions[\"examined\"]\n",
    "    return sessions.sort_values(\"grade\", ascending=False)\n",
    "\n",
    "def get_sample_sessions(query):\n",
    "    sessions = get_sessions(query, index=False) \n",
    "    sessions = sessions[sessions[\"sess_id\"] < 50050]\n",
    "    return sessions.set_index(\"sess_id\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>clicked</th>\n",
       "      <th>examined</th>\n",
       "      <th>grade</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>doc_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>600603132872</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>827396513927</th>\n",
       "      <td>14</td>\n",
       "      <td>34</td>\n",
       "      <td>0.411765</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25192073007</th>\n",
       "      <td>8</td>\n",
       "      <td>20</td>\n",
       "      <td>0.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>885170033412</th>\n",
       "      <td>6</td>\n",
       "      <td>19</td>\n",
       "      <td>0.315789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600603141003</th>\n",
       "      <td>8</td>\n",
       "      <td>26</td>\n",
       "      <td>0.307692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24543672067</th>\n",
       "      <td>8</td>\n",
       "      <td>27</td>\n",
       "      <td>0.296296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>813774010904</th>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>0.285714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>883929140855</th>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>0.285714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22265052211</th>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>0.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>786936817232</th>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>0.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>883929197965</th>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>0.222222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>719192580374</th>\n",
       "      <td>4</td>\n",
       "      <td>18</td>\n",
       "      <td>0.222222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>711719983156</th>\n",
       "      <td>2</td>\n",
       "      <td>10</td>\n",
       "      <td>0.200000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36725608443</th>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0.166667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36725617605</th>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>0.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>826663129342</th>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>0.111111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36725608894</th>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0.100000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>711719804604</th>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0.100000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75993997675</th>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>0.090909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>786936817218</th>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.071429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22265004517</th>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.071429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>786936805017</th>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>0.071429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58231306590</th>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58231300826</th>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36725608511</th>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27242809710</th>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25192107191</th>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23942972389</th>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>885170038875</th>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              clicked  examined     grade\n",
       "doc_id                                   \n",
       "600603132872        1         1  1.000000\n",
       "827396513927       14        34  0.411765\n",
       "25192073007         8        20  0.400000\n",
       "885170033412        6        19  0.315789\n",
       "600603141003        8        26  0.307692\n",
       "24543672067         8        27  0.296296\n",
       "813774010904        2         7  0.285714\n",
       "883929140855        2         7  0.285714\n",
       "22265052211         1         4  0.250000\n",
       "786936817232        2         8  0.250000\n",
       "883929197965        2         9  0.222222\n",
       "719192580374        4        18  0.222222\n",
       "711719983156        2        10  0.200000\n",
       "36725608443         1         6  0.166667\n",
       "36725617605         1         8  0.125000\n",
       "826663129342        1         9  0.111111\n",
       "36725608894         1        10  0.100000\n",
       "711719804604        1        10  0.100000\n",
       "75993997675         1        11  0.090909\n",
       "786936817218        1        14  0.071429\n",
       "22265004517         1        14  0.071429\n",
       "786936805017        1        14  0.071429\n",
       "58231306590         0         7  0.000000\n",
       "58231300826         0         8  0.000000\n",
       "36725608511         0        11  0.000000\n",
       "27242809710         0         6  0.000000\n",
       "25192107191         0         7  0.000000\n",
       "23942972389         0        15  0.000000\n",
       "885170038875        0         5  0.000000"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sessions = get_sample_sessions(\"blue ray\")\n",
    "grade_data = calculate_grade(sessions)\n",
    "#print_dataframe(grade_data)\n",
    "display(grade_data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Figure 11.8\n",
    "\n",
    "Beta distribution for grade=0.125"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a=2.5 b=17.5\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f6f87e44d00>]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAGdCAYAAABO2DpVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5N0lEQVR4nO3deXxV5b3v8e/OzJCJIYwBQWRQRmUwIAIyqTh7tFprbW9f7akX23q8Pbdy23Ns623htN5bTtVrLa3iqUfRDs4KKmUeZIwiIAKCBkmYhCRMIcle94/nBBLca2XvZO9n77X35/16rRewn7WTn0tIvnnGgOM4jgAAAKIgLd4FAACA5EGwAAAAUUOwAAAAUUOwAAAAUUOwAAAAUUOwAAAAUUOwAAAAUUOwAAAAUZNh+xMGg0Ht379fubm5CgQCtj89AABoAcdxVF1dre7duystzb1fwnqw2L9/v4qLi21/WgAAEAVlZWXq2bOna7v1YJGbmyvJFJaXl2f70wMAgBaoqqpScXHx2e/jbqwHi4bhj7y8PIIFAAA+09w0BiZvAgCAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqCFYAACAqLG+pTcsOX1a2rJF+vBDad8+6fBhqa5OSk+XOnSQuneXBg6Uhg6VCgriXS0AIEkEHMdxbH7Cqqoq5efnq7KykrNCYqGyUlq0SFqxQjpzpvn7AwETLqZNk/r1i319AABfCvf7Nz0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jj2dsRzyes+M4qq6uVvfu3ZXmcRy79R6LtLQ09ezZM+ofNy8vj7/EMcYztoPnHHs849jjGdth+zl79VQ0YPImAACIGoIFAACIGt8Hi+zsbD300EPKzs6OdylJi2dsB8859njGsccztiORn7P1yZsAACB5+b7HAgAAJA6CBQAAiBqCBQAAiBqCBQAAiBpfBIvHH39cF1xwgXJycjRmzBitW7fO8/4///nPGjhwoHJycjRkyBC9+eablir1r0ie8datW3XrrbfqggsuUCAQ0Ny5c+0V6nORPOd58+Zp/PjxKiwsVGFhoaZMmdLs331E9oz/9re/aeTIkSooKFC7du00fPhw/elPf7JYrT9F+jW5wYIFCxQIBHTTTTfFtsAkEclznj9/vgKBQJMrJyfHYrWNOAluwYIFTlZWlvPUU085W7dudb797W87BQUFzoEDB0Lev2rVKic9Pd351a9+5Wzbts35yU9+4mRmZjpbtmyxXLl/RPqM161b5/zwhz90nn/+eadr167Ob37zG7sF+1Skz/mrX/2q8/jjjzubN292tm/f7nzjG99w8vPznX379lmu3D8ifcZLlixx/va3vznbtm1zdu3a5cydO9dJT093Fi5caLly/4j0GTfYs2eP06NHD2f8+PHOjTfeaKdYH4v0OT/99NNOXl6eU15efvaqqKiwXLWR8MFi9OjRzsyZM8/+ub6+3unevbsze/bskPfffvvtzowZM5q8NmbMGOcf//EfY1qnn0X6jBvr3bs3wSJMrXnOjuM4dXV1Tm5urvPMM8/EqkTfa+0zdhzHGTFihPOTn/wkFuUlhZY847q6Omfs2LHOH/7wB+eee+4hWIQh0uf89NNPO/n5+Zaq85bQQyFnzpzRxo0bNWXKlLOvpaWlacqUKVqzZk3I96xZs6bJ/ZI0ffp01/tTXUueMSIXjed88uRJ1dbWqkOHDrEq09da+4wdx9HixYu1Y8cOXXnllbEs1bda+ox//vOfq6ioSN/61rdslOl7LX3Ox48fV+/evVVcXKwbb7xRW7dutVHulyR0sDh8+LDq6+vVpUuXJq936dJFFRUVId9TUVER0f2priXPGJGLxnP+0Y9+pO7du38pOMNo6TOurKxU+/bt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KGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKKGYAEAAKLm/wP7TtPtUE1SjQAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Why is this rendering small?\n",
    "from scipy.stats import beta\n",
    "\n",
    "prior_grade = 0.125\n",
    "prior_weight = 20\n",
    "a = prior_grade * prior_weight; b = (1 - prior_grade) * prior_weight\n",
    "print(f\"a={a} b={b}\")\n",
    "\n",
    "x = numpy.linspace(beta.ppf(0.0001, a, b), beta.ppf(0.9999, a, b), 10000)\n",
    "fig, ax = plt.subplots(1, 1)\n",
    "ax.plot(x, beta.pdf(x, a, b), 'r-', lw=5, alpha=0.6, label='beta pdf')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Figure 11.9\n",
    "\n",
    "Adding clicks to the beta distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a=3.5 b=17.5\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f6f7fd45900>]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAGdCAYAAABO2DpVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5dUlEQVR4nO3deXRV5b3/8c85GRmSEJlTAsisIIMIEQREQalSq7Zqa73Vers6Xexqf97en/Jrl7a3A17rutfWeq2XOrS1La2ttk6gGGYEZVQEREDAIDOGTEims39/PJdJz7NPTnLOk33Oeb/W2guSZyfn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S1/yHn74YW/Dhg3e1q1bva985SteUVGRt3fvXseVB0+8z3Lx4sXeM888423ZssXbsWOH9+CDD3pZWVneggULHFcePPE+y5N27drlfepTn/ImT57sXXvttW6KDbh4n+UTTzzhFRYWevv37z91HThwwHHVwRWoYDF+/Hhv1qxZp95ubm72SkpKvDlz5kS9/6abbvJmzpx51vvKysq8b3zjG0mtMxXE+yzP1K9fP4LFGdryLD3P85qamryCggLvt7/9bbJKTBltfZae53ljxozxfvCDHySjvJTSmmfZ1NTkTZw40fvNb37j3XbbbQSL/xXvs3ziiSe8oqIiR9WlnsAMhTQ0NGjdunWaPn36qfeFw2FNnz5dq1ativoxq1atOut+SZoxY4b1/kzRmmeJ6BLxLI8fP67Gxkadc845ySozJbT1WXqep/Lycm3btk1TpkxJZqmB19pn+e///u/q0aOHvvrVr7ooMyW09lnW1taqX79+Ki0t1bXXXqvNmze7KDclBCZYHDlyRM3NzerZs+dZ7+/Zs6cOHDgQ9WMOHDgQ1/2ZojXPEtEl4lneddddKikp+UQIzjStfZZVVVXq3LmzcnNzNXPmTD300EO64oorkl1uoLXmWa5YsUKPPfaY5s6d66LElNGaZzl06FA9/vjj+sc//qGnnnpKkUhEEydO1N69e12UHHjOTzcFMsl9992nefPmacmSJUzuaqWCggJt3LhRtbW1Ki8v15133qkBAwZo6tSp7V1ayqipqdGXv/xlzZ07V926dWvvclLehAkTNGHChFNvT5w4Ueedd54effRR/fjHP27HyoIhMMGiW7duysrK0sGDB896/8GDB9WrV6+oH9OrV6+47s8UrXmWiK4tz/KBBx7Qfffdp1dffVUjR45MZpkpobXPMhwOa9CgQZKk0aNHa+vWrZozZ05GB4t4n+XOnTu1e/duXXPNNafeF4lEJEnZ2dnatm2bBg4cmNyiAyoR3y9zcnI0ZswY7dixIxklppzADIXk5uZq7NixKi8vP/W+SCSi8vLys5LhmSZMmHDW/ZK0cOFC6/2ZojXPEtG19lnef//9+vGPf6wFCxbooosuclFq4CXq6zISiai+vj4ZJaaMeJ/lsGHDtGnTJm3cuPHU9dnPflaXXXaZNm7cqNLSUpflB0oivi6bm5u1adMm9e7dO1llppb2nj16pnnz5nl5eXnek08+6W3ZssX7+te/7nXp0uXUMp4vf/nL3t13333q/pUrV3rZ2dneAw884G3dutW79957WW76v+J9lvX19d6GDRu8DRs2eL179/a+973veRs2bPC2b9/eXv+EwIj3Wd53331ebm6u99e//vWs5Wg1NTXt9U8IjHif5c9+9jPvlVde8Xbu3Olt2bLFe+CBB7zs7Gxv7ty57fVPCIx4n+XHsSrktHif5Y9+9CPv5Zdf9nbu3OmtW7fO++IXv+jl5+d7mzdvbq9/QqAEKlh4nuc99NBDXt++fb3c3Fxv/Pjx3urVq0+1XXrppd5tt9121v1/+ctfvCFDhni5ubne8OHDvRdffNFxxcEVz7PctWuXJ+kT16WXXuq+8ACK51n269cv6rO899573RceQPE8y+9///veoEGDvPz8fK+4uNibMGGCN2/evHaoOpji/X55JoLF2eJ5lt/97ndP3duzZ0/v6quv9tavX98OVQcTx6YDAICECcwcCwAAkPoIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGEIFgAAIGH+P+ucggi4Ib76AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Fit a beta prior to global_ctr\n",
    "a += 1\n",
    "print(f\"a={a} b={b}\")\n",
    "\n",
    "x = numpy.linspace(beta.ppf(0.0001, a, b), beta.ppf(0.9999, a, b), 10000)\n",
    "fig, ax = plt.subplots(1, 1)\n",
    "\n",
    "ax.plot(x, beta.pdf(x, a, b),\n",
    "        \"r-\", lw=5, alpha=0.6, label=\"beta pdf\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Listing 11.12\n",
    "\n",
    "Starting with a prior beta distribution for each document for \"blue ray\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def calculate_prior(sessions, prior_grade, prior_weight):\n",
    "  sessions = calculate_grade(sessions)\n",
    "  sessions[\"prior_a\"] = prior_grade * prior_weight\n",
    "  sessions[\"prior_b\"] = (1 - prior_grade) * prior_weight \n",
    "  return sessions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              clicked  examined     grade  prior_a  prior_b\n",
      "doc_id                                                     \n",
      "600603132872        1         1  1.000000     30.0     70.0\n",
      "827396513927       14        34  0.411765     30.0     70.0\n",
      "25192073007         8        20  0.400000     30.0     70.0\n",
      "885170033412        6        19  0.315789     30.0     70.0\n",
      "600603141003        8        26  0.307692     30.0     70.0\n",
      "24543672067         8        27  0.296296     30.0     70.0\n",
      "813774010904        2         7  0.285714     30.0     70.0\n",
      "883929140855        2         7  0.285714     30.0     70.0\n",
      "22265052211         1         4  0.250000     30.0     70.0\n",
      "786936817232        2         8  0.250000     30.0     70.0\n",
      "883929197965        2         9  0.222222     30.0     70.0\n",
      "719192580374        4        18  0.222222     30.0     70.0\n",
      "711719983156        2        10  0.200000     30.0     70.0\n",
      "36725608443         1         6  0.166667     30.0     70.0\n",
      "36725617605         1         8  0.125000     30.0     70.0\n",
      "826663129342        1         9  0.111111     30.0     70.0\n",
      "36725608894         1        10  0.100000     30.0     70.0\n",
      "711719804604        1        10  0.100000     30.0     70.0\n",
      "75993997675         1        11  0.090909     30.0     70.0\n",
      "786936817218        1        14  0.071429     30.0     70.0\n",
      "22265004517         1        14  0.071429     30.0     70.0\n",
      "786936805017        1        14  0.071429     30.0     70.0\n",
      "58231306590         0         7  0.000000     30.0     70.0\n",
      "58231300826         0         8  0.000000     30.0     70.0\n",
      "36725608511         0        11  0.000000     30.0     70.0\n",
      "27242809710         0         6  0.000000     30.0     70.0\n",
      "25192107191         0         7  0.000000     30.0     70.0\n",
      "23942972389         0        15  0.000000     30.0     70.0\n",
      "885170038875        0         5  0.000000     30.0     70.0\n"
     ]
    }
   ],
   "source": [
    "prior_grade = 0.3\n",
    "prior_weight = 100\n",
    "query = \"blue ray\"\n",
    "sessions = get_sample_sessions(query)\n",
    "prior_data = calculate_prior(sessions, prior_grade, prior_weight)\n",
    "print(prior_data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Listing 11.13\n",
    "\n",
    "Here we update the beta posterior to account for the observations in our data. We then compute a new grade, `beta-grade` from the posterior distribution."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%load -s calculate_sdbn ../ltr/sdbn_functions.py\n",
    "def calculate_sdbn(sessions, prior_grade=0.3, prior_weight=100):\n",
    "    sessions = calculate_prior(sessions, prior_grade, prior_weight)\n",
    "    sessions[\"posterior_a\"] = (sessions[\"prior_a\"] + \n",
    "                               sessions[\"clicked\"])\n",
    "    sessions[\"posterior_b\"] = (sessions[\"prior_b\"] + \n",
    "      sessions[\"examined\"] - sessions[\"clicked\"])\n",
    "    sessions[\"beta_grade\"] = (sessions[\"posterior_a\"] /\n",
    "      (sessions[\"posterior_a\"] + sessions[\"posterior_b\"]))\n",
    "    return sessions.sort_values(\"beta_grade\", ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              clicked  examined     grade  prior_a  prior_b  posterior_a  \\\n",
      "doc_id                                                                     \n",
      "827396513927       14        34  0.411765     30.0     70.0         44.0   \n",
      "25192073007         8        20  0.400000     30.0     70.0         38.0   \n",
      "600603132872        1         1  1.000000     30.0     70.0         31.0   \n",
      "885170033412        6        19  0.315789     30.0     70.0         36.0   \n",
      "600603141003        8        26  0.307692     30.0     70.0         38.0   \n",
      "24543672067         8        27  0.296296     30.0     70.0         38.0   \n",
      "813774010904        2         7  0.285714     30.0     70.0         32.0   \n",
      "883929140855        2         7  0.285714     30.0     70.0         32.0   \n",
      "22265052211         1         4  0.250000     30.0     70.0         31.0   \n",
      "786936817232        2         8  0.250000     30.0     70.0         32.0   \n",
      "883929197965        2         9  0.222222     30.0     70.0         32.0   \n",
      "36725608443         1         6  0.166667     30.0     70.0         31.0   \n",
      "711719983156        2        10  0.200000     30.0     70.0         32.0   \n",
      "719192580374        4        18  0.222222     30.0     70.0         34.0   \n",
      "36725617605         1         8  0.125000     30.0     70.0         31.0   \n",
      "885170038875        0         5  0.000000     30.0     70.0         30.0   \n",
      "826663129342        1         9  0.111111     30.0     70.0         31.0   \n",
      "27242809710         0         6  0.000000     30.0     70.0         30.0   \n",
      "36725608894         1        10  0.100000     30.0     70.0         31.0   \n",
      "711719804604        1        10  0.100000     30.0     70.0         31.0   \n",
      "58231306590         0         7  0.000000     30.0     70.0         30.0   \n",
      "25192107191         0         7  0.000000     30.0     70.0         30.0   \n",
      "75993997675         1        11  0.090909     30.0     70.0         31.0   \n",
      "58231300826         0         8  0.000000     30.0     70.0         30.0   \n",
      "786936817218        1        14  0.071429     30.0     70.0         31.0   \n",
      "22265004517         1        14  0.071429     30.0     70.0         31.0   \n",
      "786936805017        1        14  0.071429     30.0     70.0         31.0   \n",
      "36725608511         0        11  0.000000     30.0     70.0         30.0   \n",
      "23942972389         0        15  0.000000     30.0     70.0         30.0   \n",
      "\n",
      "              posterior_b  beta_grade  \n",
      "doc_id                                 \n",
      "827396513927         90.0    0.328358  \n",
      "25192073007          82.0    0.316667  \n",
      "600603132872         70.0    0.306931  \n",
      "885170033412         83.0    0.302521  \n",
      "600603141003         88.0    0.301587  \n",
      "24543672067          89.0    0.299213  \n",
      "813774010904         75.0    0.299065  \n",
      "883929140855         75.0    0.299065  \n",
      "22265052211          73.0    0.298077  \n",
      "786936817232         76.0    0.296296  \n",
      "883929197965         77.0    0.293578  \n",
      "36725608443          75.0    0.292453  \n",
      "711719983156         78.0    0.290909  \n",
      "719192580374         84.0    0.288136  \n",
      "36725617605          77.0    0.287037  \n",
      "885170038875         75.0    0.285714  \n",
      "826663129342         78.0    0.284404  \n",
      "27242809710          76.0    0.283019  \n",
      "36725608894          79.0    0.281818  \n",
      "711719804604         79.0    0.281818  \n",
      "58231306590          77.0    0.280374  \n",
      "25192107191          77.0    0.280374  \n",
      "75993997675          80.0    0.279279  \n",
      "58231300826          78.0    0.277778  \n",
      "786936817218         83.0    0.271930  \n",
      "22265004517          83.0    0.271930  \n",
      "786936805017         83.0    0.271930  \n",
      "36725608511          81.0    0.270270  \n",
      "23942972389          85.0    0.260870  \n"
     ]
    }
   ],
   "source": [
    "query = \"blue ray\"\n",
    "sessions = get_sample_sessions(query)\n",
    "bluray_sdbn_data = calculate_sdbn(sessions)\n",
    "print(bluray_sdbn_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <style>img {width:125px; height:125px; }\n",
       "               tr {font-size:24px; text-align:left; font-weight:normal; }\n",
       "               td {padding-right:40px; text-align:left; }\n",
       "               th {font-size:28px; text-align:left; }\n",
       "               th:nth-child(4) {width:125px; }</style><h1>SDBN judgments for q=blue ray</h><table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>beta_grade</th>\n",
       "      <th>upc</th>\n",
       "      <th>image</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.3284</td>\n",
       "      <td>827396513927.0000</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/unavailable.jpg\"></td>\n",
       "      <td>Panasonic - Refurbished Wi-Fi Ready Blu-ray Disc Player</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.3167</td>\n",
       "      <td>25192073007.0000</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/unavailable.jpg\"></td>\n",
       "      <td>The Blues Brothers - Widescreen Dubbed Subtitle - Blu-ray Disc</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.3167</td>\n",
       "      <td>25192073007.0000</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/unavailable.jpg\"></td>\n",
       "      <td>Blues Brothers (Rated) (Unrated) - Widescreen Dubbed Subtitle - Blu-ray Disc</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.3069</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.3025</td>\n",
       "      <td>885170033412.0000</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/unavailable.jpg\"></td>\n",
       "      <td>Panasonic - Blu-ray Player</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "render_judged(products,\n",
    "              bluray_sdbn_data,\n",
    "              grade_col=\"beta_grade\",\n",
    "              label=f\"SDBN judgments for q={query}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>image</th>\n",
       "      <th>upc</th>\n",
       "      <th>name</th>\n",
       "      <th>name_ngram</th>\n",
       "      <th>name_omit_norms</th>\n",
       "      <th>name_txt_en_split</th>\n",
       "      <th>manufacturer</th>\n",
       "      <th>short_description</th>\n",
       "      <th>long_description</th>\n",
       "      <th>id</th>\n",
       "      <th>_version_</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>294</th>\n",
       "      <td>&lt;img height=\"100\" src=\"../../data/retrotech/im...</td>\n",
       "      <td>25192073007</td>\n",
       "      <td>The Blues Brothers - Widescreen Dubbed Subtitl...</td>\n",
       "      <td>The Blues Brothers - Widescreen Dubbed Subtitl...</td>\n",
       "      <td>The Blues Brothers - Widescreen Dubbed Subtitl...</td>\n",
       "      <td>The Blues Brothers - Widescreen Dubbed Subtitl...</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>2be731df-5f78-44ce-8b6f-f5017a7dde92</td>\n",
       "      <td>1810006029686013962</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>302</th>\n",
       "      <td>&lt;img height=\"100\" src=\"../../data/retrotech/im...</td>\n",
       "      <td>25192073007</td>\n",
       "      <td>Blues Brothers (Rated) (Unrated) - Widescreen ...</td>\n",
       "      <td>Blues Brothers (Rated) (Unrated) - Widescreen ...</td>\n",
       "      <td>Blues Brothers (Rated) (Unrated) - Widescreen ...</td>\n",
       "      <td>Blues Brothers (Rated) (Unrated) - Widescreen ...</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>bb7c3573-b217-45d7-bf78-17111e6b6bec</td>\n",
       "      <td>1810006029653508104</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 image          upc  \\\n",
       "294  <img height=\"100\" src=\"../../data/retrotech/im...  25192073007   \n",
       "302  <img height=\"100\" src=\"../../data/retrotech/im...  25192073007   \n",
       "\n",
       "                                                  name  \\\n",
       "294  The Blues Brothers - Widescreen Dubbed Subtitl...   \n",
       "302  Blues Brothers (Rated) (Unrated) - Widescreen ...   \n",
       "\n",
       "                                            name_ngram  \\\n",
       "294  The Blues Brothers - Widescreen Dubbed Subtitl...   \n",
       "302  Blues Brothers (Rated) (Unrated) - Widescreen ...   \n",
       "\n",
       "                                       name_omit_norms  \\\n",
       "294  The Blues Brothers - Widescreen Dubbed Subtitl...   \n",
       "302  Blues Brothers (Rated) (Unrated) - Widescreen ...   \n",
       "\n",
       "                                     name_txt_en_split manufacturer  \\\n",
       "294  The Blues Brothers - Widescreen Dubbed Subtitl...                \n",
       "302  Blues Brothers (Rated) (Unrated) - Widescreen ...                \n",
       "\n",
       "    short_description long_description                                    id  \\\n",
       "294                                     2be731df-5f78-44ce-8b6f-f5017a7dde92   \n",
       "302                                     bb7c3573-b217-45d7-bf78-17111e6b6bec   \n",
       "\n",
       "               _version_  \n",
       "294  1810006029686013962  \n",
       "302  1810006029653508104  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "products[products[\"upc\"] == 25192073007]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Figure 11.10 source code\n",
    "\n",
    "Rendering beta distribution updated judgments to model our confidence in them"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <style>img {width:125px; height:125px; }\n",
       "               tr {font-size:24px; text-align:left; font-weight:normal; }\n",
       "               td {padding-right:40px; text-align:left; }\n",
       "               th {font-size:28px; text-align:left; }\n",
       "               th:nth-child(4) {width:125px; }</style><h1>Confidence Adjusted SDBN judgments for q=dryer</h><table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>beta_grade</th>\n",
       "      <th>upc</th>\n",
       "      <th>image</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.3853</td>\n",
       "      <td>856751002097</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/856751002097.jpg\"></td>\n",
       "      <td>Practecol - Dryer Balls (2-Pack)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.3748</td>\n",
       "      <td>48231011396</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/48231011396.jpg\"></td>\n",
       "      <td>LG - 3.5 Cu. Ft. 7-Cycle High-Efficiency Washer - White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.3158</td>\n",
       "      <td>84691226727</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/84691226727.jpg\"></td>\n",
       "      <td>GE - 6.0 Cu. Ft. 3-Cycle Electric Dryer - White</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.2946</td>\n",
       "      <td>74108007469</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/74108007469.jpg\"></td>\n",
       "      <td>Conair - 1875-Watt Folding Handle Hair Dryer - Blue</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.2775</td>\n",
       "      <td>12505525766</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/12505525766.jpg\"></td>\n",
       "      <td>Smart Choice - 6' 30 Amp 3-Prong Dryer Cord</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "query = \"dryer\"\n",
    "sessions = get_sessions(query)\n",
    "dryer_sdbn = calculate_sdbn(sessions, 0.3, 100)\n",
    "\n",
    "render_judged(products, \n",
    "              dryer_sdbn, \n",
    "              grade_col='beta_grade',\n",
    "              label=f\"Confidence Adjusted SDBN judgments for q={query}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Figure 11.11 source code\n",
    "\n",
    "Rendering beta distribution updated judgments to model our confidence in them"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <style>img {width:125px; height:125px; }\n",
       "               tr {font-size:24px; text-align:left; font-weight:normal; }\n",
       "               td {padding-right:40px; text-align:left; }\n",
       "               th {font-size:28px; text-align:left; }\n",
       "               th:nth-child(4) {width:125px; }</style><h1>Confidence Adjusted SDBN judgments for <br> q=transformers dark of the moon</h><table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>beta_grade</th>\n",
       "      <th>upc</th>\n",
       "      <th>image</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.5957</td>\n",
       "      <td>97360810042</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/97360810042.jpg\"></td>\n",
       "      <td>Transformers: Dark of the Moon - Blu-ray Disc</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.4017</td>\n",
       "      <td>400192926087</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/400192926087.jpg\"></td>\n",
       "      <td>Transformers: Dark of the Moon - Original Soundtrack - CD</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.3673</td>\n",
       "      <td>97363560449</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/97363560449.jpg\"></td>\n",
       "      <td>Transformers: Dark of the Moon - Widescreen Dubbed Subtitle - DVD</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.3130</td>\n",
       "      <td>97363532149</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/97363532149.jpg\"></td>\n",
       "      <td>Transformers: Revenge of the Fallen - Widescreen Dubbed Subtitle - DVD</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.2795</td>\n",
       "      <td>93624956037</td>\n",
       "      <td><img height=\"100\" src=\"../../data/retrotech/images/93624956037.jpg\"></td>\n",
       "      <td>Transformers: Dark of the Moon - Original Soundtrack - CD</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "query = \"transformers dark of the moon\"\n",
    "sessions = get_sessions(query)\n",
    "transformers_sdbn = calculate_sdbn(sessions, 0.3, 100)\n",
    "\n",
    "render_judged(products, \n",
    "              transformers_sdbn, \n",
    "              grade_col='beta_grade',\n",
    "              label=f\"Confidence Adjusted SDBN judgments for <br> q={query}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div id=\"demo\">\n",
       "\t<center><input style=\"width:40%\" readonly type=\"text\" name=\"q\" value=\"transformers dvd\">\n",
       "\t<input readonly type=\"submit\" value=\"Search\">\n",
       "\t</center>\n",
       "    <div class=\"results\">\n",
       "    \t\n",
       "\n",
       "    </div>\n",
       "</div>\n",
       "    \t<div style=\"position: relative; width: 100%; height:auto; overflow: auto;\">\n",
       "\t    \t<div style=\"position: relative; float:left; width: 120px; margin-top:5px\">\n",
       "\t    \t\t<img style=\"width:250px; height: auto; max-height:150px\" src=\"../../data/retrotech/images/32429037763.jpg\">\n",
       "\t    \t</div>\n",
       "\t    \t<div style=\"position:relative; float:left; clear:none; width: 80%; height:auto\">\n",
       "\t    \t\t<p style=\"font-size:24px; padding-left: 50px;\"><strong>\t\tName:</strong> Transformers - DVD\n",
       "\t\t\t\t\t<br><strong>\t\tManufacturer:</strong>  </p>\n",
       "\t    \t\t</p>\n",
       "\t    \t</div>\n",
       "    \t</div>\n",
       "    \t\n",
       "\t\t<div style=\"position:relative; clear:both; content: ' '; display: block; height: 1px; margin-top: 10px; margin-bottom:20px\">\n",
       "\t\t\t<hr style=\"color: gray; width: 95%;\" />\n",
       "\t\t</div>\n",
       "\t\t\n",
       "    \t<div style=\"position: relative; width: 100%; height:auto; overflow: auto;\">\n",
       "\t    \t<div style=\"position: relative; float:left; width: 120px; margin-top:5px\">\n",
       "\t    \t\t<img style=\"width:250px; height: auto; max-height:150px\" src=\"../../data/retrotech/images/708056579746.jpg\">\n",
       "\t    \t</div>\n",
       "\t    \t<div style=\"position:relative; float:left; clear:none; width: 80%; height:auto\">\n",
       "\t    \t\t<p style=\"font-size:24px; padding-left: 50px;\"><strong>\t\tName:</strong> Nintendo - Transformers 3 Stylus 2-Pack\n",
       "\t\t\t\t\t<br><strong>\t\tManufacturer:</strong> Nintendo</p>\n",
       "\t    \t\t</p>\n",
       "\t    \t</div>\n",
       "    \t</div>\n",
       "    \t\n",
       "\t\t<div style=\"position:relative; clear:both; content: ' '; display: block; height: 1px; margin-top: 10px; margin-bottom:20px\">\n",
       "\t\t\t<hr style=\"color: gray; width: 95%;\" />\n",
       "\t\t</div>\n",
       "\t\t\n",
       "    \t<div style=\"position: relative; width: 100%; height:auto; overflow: auto;\">\n",
       "\t    \t<div style=\"position: relative; float:left; width: 120px; margin-top:5px\">\n",
       "\t    \t\t<img style=\"width:250px; height: auto; max-height:150px\" src=\"../../data/retrotech/images/708056579739.jpg\">\n",
       "\t    \t</div>\n",
       "\t    \t<div style=\"position:relative; float:left; clear:none; width: 80%; height:auto\">\n",
       "\t    \t\t<p style=\"font-size:24px; padding-left: 50px;\"><strong>\t\tName:</strong> Nintendo - Transformers 3 Cybertanium Case\n",
       "\t\t\t\t\t<br><strong>\t\tManufacturer:</strong> Nintendo</p>\n",
       "\t    \t\t</p>\n",
       "\t    \t</div>\n",
       "    \t</div>\n",
       "    \t\n",
       "\t\t<div style=\"position:relative; clear:both; content: ' '; display: block; height: 1px; margin-top: 10px; margin-bottom:20px\">\n",
       "\t\t\t<hr style=\"color: gray; width: 95%;\" />\n",
       "\t\t</div>\n",
       "\t\t\n",
       "    \t<div style=\"position: relative; width: 100%; height:auto; overflow: auto;\">\n",
       "\t    \t<div style=\"position: relative; float:left; width: 120px; margin-top:5px\">\n",
       "\t    \t\t<img style=\"width:250px; height: auto; max-height:150px\" src=\"../../data/retrotech/images/603497664429.jpg\">\n",
       "\t    \t</div>\n",
       "\t    \t<div style=\"position:relative; float:left; clear:none; width: 80%; height:auto\">\n",
       "\t    \t\t<p style=\"font-size:24px; padding-left: 50px;\"><strong>\t\tName:</strong> The Transformers: The Movie - DVD\n",
       "\t\t\t\t\t<br><strong>\t\tManufacturer:</strong>  </p>\n",
       "\t    \t\t</p>\n",
       "\t    \t</div>\n",
       "    \t</div>\n",
       "    \t\n",
       "\t\t<div style=\"position:relative; clear:both; content: ' '; display: block; height: 1px; margin-top: 10px; margin-bottom:20px\">\n",
       "\t\t\t<hr style=\"color: gray; width: 95%;\" />\n",
       "\t\t</div>\n",
       "\t\t\n",
       "    \t<div style=\"position: relative; width: 100%; height:auto; overflow: auto;\">\n",
       "\t    \t<div style=\"position: relative; float:left; width: 120px; margin-top:5px\">\n",
       "\t    \t\t<img style=\"width:250px; height: auto; max-height:150px\" src=\"../../data/retrotech/images/826663126044.jpg\">\n",
       "\t    \t</div>\n",
       "\t    \t<div style=\"position:relative; float:left; clear:none; width: 80%; height:auto\">\n",
       "\t    \t\t<p style=\"font-size:24px; padding-left: 50px;\"><strong>\t\tName:</strong> Transformers Japanese Collection: Headmasters - DVD\n",
       "\t\t\t\t\t<br><strong>\t\tManufacturer:</strong>  </p>\n",
       "\t    \t\t</p>\n",
       "\t    \t</div>\n",
       "    \t</div>\n",
       "    \t\n",
       "\t\t<div style=\"position:relative; clear:both; content: ' '; display: block; height: 1px; margin-top: 10px; margin-bottom:20px\">\n",
       "\t\t\t<hr style=\"color: gray; width: 95%;\" />\n",
       "\t\t</div>\n",
       "\t\t"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# %load -s product_search_request aips/search_requests\n",
    "def product_search_request(query, param_overrides={}):\n",
    "    request = {\"query\": query,\n",
    "               \"query_fields\": [\"name\", \"manufacturer\", \"long_description\"],\n",
    "               \"return_fields\": [\"upc\", \"name\", \"manufacturer\", \"score\"],\n",
    "               \"limit\": 5,\n",
    "               \"order_by\": [(\"score\", \"desc\"), (\"upc\", \"asc\")]}\n",
    "    return request | param_overrides\n",
    "\n",
    "from aips import get_engine\n",
    "query = \"transformers dvd\"\n",
    "request = product_search_request(query)\n",
    "response = get_engine().get_collection(\"products\").search(**request)\n",
    "display_product_search(query, response[\"docs\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Up next: [Chapter 12: Overcoming Bias in Learned Relevance Models](../ch12/0.setup.ipynb)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
